#ifndef __RTTHREAD_STACK_H__
#define __RTTHREAD_STACK_H__

#include "rt_def.h"

struct exception_stack_frame
{
    /* 异常发生时自动保存的寄存器 */
    rt_uint32_t r0;
    rt_uint32_t r1;
    rt_uint32_t r2;
    rt_uint32_t r3;
    rt_uint32_t r12;
    rt_uint32_t lr;
    rt_uint32_t pc;
    rt_uint32_t psr;
};

struct stack_frame
{
    /* r4 ~ r11 register
    异常发生时需手动保存的寄存器 */
    rt_uint32_t r4;
    rt_uint32_t r5;
    rt_uint32_t r6;
    rt_uint32_t r7;
    rt_uint32_t r8;
    rt_uint32_t r9;
    rt_uint32_t r10;
    rt_uint32_t r11;

    struct exception_stack_frame exception_stack_frame;
};


/* 线程栈初始化 */
rt_uint8_t *rt_hw_stack_init(void       *tentry,
                            void       *parameter,
                            rt_uint8_t *stack_addr);



#endif /* __RTTHREAD_STACK_H__ */